#ifndef _LINUX_SWAP_H
#define _LINUX_SWAP_H
#include <linux/list.h>
extern int nr_swap_pages;
extern int nr_active_pages;
extern int nr_inactive_pages;
extern spinlock_cacheline_t pagemap_lru_lock_cacheline;
#define pagemap_lru_lock pagemap_lru_lock_cacheline.lock
extern void __lru_cache_del(struct page *);
extern void lru_cache_del(struct page *);
#define add_page_to_active_list(page)		\
do {						\
	DEBUG_LRU_PAGE(page);			\
	SetPageActive(page);			\
	list_add(&(page)->lru, &active_list);	\
	nr_active_pages++;			\
} while (0)

#define add_page_to_inactive_list(page)		\
do {						\
	DEBUG_LRU_PAGE(page);			\
	list_add(&(page)->lru, &inactive_list);	\
	nr_inactive_pages++;			\
} while (0)

#define del_page_from_active_list(page)		\
do {						\
	list_del(&(page)->lru);			\
	ClearPageActive(page);			\
	nr_active_pages--;			\
} while (0)

#define del_page_from_inactive_list(page)	\
do {						\
	list_del(&(page)->lru);			\
	nr_inactive_pages--;			\
} while (0)
#endif //CODE_SWAP_H
